﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace TetrisByPhillAndRomaCorp
{
    public class TickGenerator
    {
        private int _spead = 700;
        public event EventHandler Tick;


        public void Start()
        {
            for (; ;)
            {

                Thread.Sleep(_spead);
                OnTick();

            }
        }

        protected virtual void OnTick()
        {
            if (this.Tick != null)
                this.Tick(this, null);
        }
    }
    
}
